package com.rd.student.jiaji.class3.xumingze.code01;

public class Hero {
    public String name;
    public Hero() {
    }

    int totalTime = 3;

    public void jineng() {
        while (true) {
            for (int i = 0; i < totalTime; i++) {
                System.out.printf("波动拳第%d发%n", i + 1);
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }

            System.out.println("开始为时5秒的充能");
            try {
                Thread.sleep(5000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }

    }

    public static void main(String[] args) {
        Hero h = new Hero();
        h.jineng();

    }
}

//    @Override
//    public void run() {
//        try {
//            for (int i = 1;i < 4;i++){
//                System.out.println("波动拳第" + i + "发");
//                Thread.sleep(1000);
//                if(i == 3)
//                    Thread.sleep(5000);
//            }
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
//        System.out.println(Thread.currentThread().getName());
//    }
//
//    public static void main(String[] args) {
//        HeroCharge heroCharge = new HeroCharge();
//        Thread thread = new Thread();
//        thread.start();
//    }

